package com.core.model;

import javax.persistence.Column;
import javax.persistence.Lob;
import javax.persistence.MappedSuperclass;


@MappedSuperclass
public abstract class Document extends AbstractEntity {
    @Column
    private String name;
    @Column(name = "content_type")
    private String contentType;
    @Lob
    @Column(name = "contents", columnDefinition = "mediumblob")
    private byte[] contents;

    protected Document() {
    }

    protected Document(String name, String contentType, byte[] contents) {
        this.name = name;
        this.contentType = contentType;
        this.contents = contents;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public byte[] getContents() {
        return contents;
    }

    public void setContents(byte[] contents) {
        this.contents = contents;
    }

    public String getContentType() {
        return contentType;
    }

    public void setContentType(String contentType) {
        this.contentType = contentType;
    }
}